# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=coordgen
pkgver=3.0.2
pkgrel=1
pkgdesc='Schrodinger-developed 2D Coordinate Generation'
arch=(x86_64)
url='https://github.com/schrodinger/coordgenlibs'
license=(BSD)
depends=(maeparser)
makedepends=(cmake boost)
source=(https://github.com/schrodinger/coordgenlibs/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('f67697434f7fec03bca150a6d84ea0e8409f6ec49d5aab43badc5833098ff4e3')

build() {
  cmake -B build -S coordgenlibs-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCOORDGEN_USE_MAEPARSER=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -Dm644 coordgenlibs-$pkgver/templates.mae -t "$pkgdir"/usr/share/coordgen
  install -Dm644 coordgenlibs-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
